<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<%@ include file="../base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${requestScope.tie.title }</title>
<link rel="stylesheet" type="text/css" href="style/style.css"/>
</head>

<body>
<%@include file="../template/top.jsp" %>


<div id="contain">
	<div class="nav">
    	<a href="index.jspx">论坛首页</a>
        &gt;
        <a href="type.jspx?_method=list&id=${requestScope.tie.type.id }">${requestScope.tie.type.name } </a>
        &gt;
        <a href="#">${requestScope.tie.title }</a>	 <span class="del"><a href="tie.jspx?_method=setbest&id=${requestScope.tie.id }">设为精华帖</a><a href="tie.jspx?_method=settop&id=${requestScope.tie.id }">置顶</a><a href="tie.jspx?_method=admindel&id=${requestScope.tie.id }">删除该贴</a></span>
  </div>	
	<table class="post_table" border="0" cellpadding="0" cellspacing="1">
    	<thead>
        	<tr>
            	<th class="author_msg">作者</th>
                <th class="posts_content">正文</th>
            </tr>
           
            	

        </thead>
        <tbody>
        	<tr>
            	<td class="author_msg_td">
           	  	  <div class="pic">
           		    <img src="${basePath }/upload/${requestScope.tie.user.pic}" width="80" height="80"/>
                    </div>
                  <h3>${requestScope.tie.user.name }</h3>
                  <h4>加入时间 ${requestScope.tie.user.regTime }</h4>
                  <h4>发帖数量：${requestScope.tie.user.tieNum }</h4>
                </td>
                <td align="left" valign="top" class="posts_content_td">
                	<div class="content_msg">
                    	1楼 此话题发表于${requestScope.tie.createTime }  
                    	<span class="read">${tie.clickNum }阅/${tie.replyNum }回</span>
                        <a href="#" class="fav">关注</a>
                        <a href="#replylink" class="replay">回复</a>
                     </div>
                	${requestScope.tie.content }
                </td>
            </tr>
           
            <c:forEach items="${requestScope.tielist }" var="r">
            <tr>
            	<td class="author_msg_td">
               	  	<div class="pic">
                   		 <img src="${basePath }/upload/${r.user.pic}" width="80" height="80"/>
                    </div>
                    <h3>${r.user.name }</h3>
                    <h4>加入时间 ${r.user.regTime }</h4>
                    <h4>发帖数量：${r.user.tieNum }</h4>
                </td>
                <td align="left" valign="top" class="posts_content_td">
               	  <div class="content_msg">
                    	${r.id }楼 ${r.user.name } 发表于${r.createTime }  
                    	<span class="read">${r.clickNum }阅/${r.replyNum }回</span>
                    	<span class="del"><a href="tie.jspx?_method=admindel&id=${r.id }">删除该楼</a></span>
                  </div>
                	 ${r.content }
                </td>
            </tr>
            </c:forEach>
            
            
        </tbody>
        <tfoot>
        	<tr>
           	  <td class="author_msg_td"></td>
                <td align="right" class="posts_content_td">
                	
   <!-- 分页 -->
  共${requestScope.pg.totalSize }条记录，每页显示${requestScope.pg.pageSize 	}条,共${requestScope.pg.totalPages }页 ，当前第${requestScope.pg.currentPage
		}页
		<c:choose>
			<c:when test="${not requestScope.pg.first}">
				<a href="tie.jspx?_method=detail&p=1&id=${requestScope.tie.id}">首页</a>
			</c:when>
			<c:otherwise>
              	     首页
              	</c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${requestScope.pg.prev}">
				<a href="tie.jspx?_method=detail&p=${requestScope.pg.currentPage-1 }&id=${requestScope.tie.id}">上一页</a>
			</c:when>
			<c:otherwise>
              	    上一页
              	</c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${requestScope.pg.next}">
				<a href="tie.jspx?_method=detail&p=${requestScope.pg.currentPage+1 }&id=${requestScope.tie.id}">下一页</a>
			</c:when>
			<c:otherwise>
              	    下一页
              	</c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${not requestScope.pg.last}">
				<a href="tie.jspx?_method=detail&p=${requestScope.pg.totalPages }&id=${requestScope.tie.id}">尾页</a>
			</c:when>
			<c:otherwise>
              	     尾页
              	</c:otherwise>
		</c:choose>
                </td>
            </tr>
        	
        </tfoot>
    </table>
</div>

<%@include file="../template/footer.jsp" %>

</body>
</html>

